#include "stm32f10x.h"                  // Device header


/**
初始化灯
0 - RCC_APB2Periph 时钟  @arg RCC_APB2Periph_AFIO, RCC_APB2Periph_GPIOA, RCC_APB2Periph_GPIOB,
  *          RCC_APB2Periph_GPIOC, RCC_APB2Periph_GPIOD, RCC_APB2Periph_GPIOE,
  *          RCC_APB2Periph_GPIOF, RCC_APB2Periph_GPIOG, RCC_APB2Periph_ADC1,
  *          RCC_APB2Periph_ADC2, RCC_APB2Periph_TIM1, RCC_APB2Periph_SPI1,
  *          RCC_APB2Periph_TIM8, RCC_APB2Periph_USART1, RCC_APB2Periph_ADC3,
  *          RCC_APB2Periph_TIM15, RCC_APB2Periph_TIM16, RCC_APB2Periph_TIM17,
  *          RCC_APB2Periph_TIM9, RCC_APB2Periph_TIM10, RCC_APB2Periph_TIM11     
  * @param  NewState: new state of the specified peripheral clock.
	
1 - GPIOx GPIOA...Z
2 - Pin Pin口
*/
void led_init(uint32_t RCC_APB2Periph,GPIO_TypeDef* GPIOx,uint16_t Pin){
	RCC_APB2PeriphClockCmd(RCC_APB2Periph,ENABLE);
	GPIO_InitTypeDef type;
	type.GPIO_Mode = GPIO_Mode_Out_PP;
	type.GPIO_Pin =  Pin; 
	type.GPIO_Speed = GPIO_Speed_50MHz;
	GPIO_Init(GPIOx,&type);
}